﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Site1.Master" AutoEventWireup="true" CodeBehind="Check_leave.aspx.cs" Inherits="ES_Project.Pages.WebForm665" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link type="text/css" href="js/js/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />	
<link type="text/css" href="js/js/css/jquery.timeentry.css" rel="stylesheet" />
  <script type="text/javascript" src="js/js/jquery-1.4.4.min.js"></script>
  <script type="text/javascript" src="js/js/jquery-ui-1.8.10.offset.datepicker.min.js"></script>
  <script type="text/javascript" src="js/js/jquery.datepick-th.js"></script>
  <script type="text/javascript" src="js/js/jquery-ui-timepicker-addon.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.min.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.pack.js"></script>
  <style type="text/css">

/* Overide css code กำหนดความกว้างของปฏิทินและอื่นๆ */ 
.ui-datepicker{

	width:170px;

	font-family:tahoma;

	font-size:11px;

	text-align:center;

}
/* css for timepicker */
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
</style>
   
   
   <style type="text/css">
table{font-size:inherit;margin-top: 0px;
    color: #000000;
}
TABLE {
	MARGIN-BOTTOM: 0px;
            margin-left: 0px;
        }
        .style3
        {
            width: 59px;
        }
        .style4
        {
            width: 1167px;
        }
    .DNNAlignright {
	TEXT-ALIGN: right
}
select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}
INPUT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; 
MARGIN-RIGHT: 0px;
    text-align: left;
}
SELECT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TEXTAREA {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TH {
	FONT-FAMILY: Tahoma, Arial, Helvetica; COLOR: #003366; FONT-SIZE: 12px; VERTICAL-ALIGN: baseline; FONT-WEIGHT: bold
}
        .style15
        {
            width: 100%;
        }
        .style16
        {
            font-size: small;
            text-align: left;
        }
        .style19
        {
            width: 47px;
        }
        .style20
        {
            width: 1167px;
            font-size: small;
        }
        .style21
        {
            width: 218px;
        }
        .style24
        {
            width: 215px;
        }
        .style27
        {
            font-size: small;
            font-weight: bold;
            text-align: right;
            width: 105px;
        }
        .style32
        {
            font-size: small;
            text-align: left;
            }
        .style33
        {
            width: 140px;
        }
        .style49
        {
            width: 193px;
        }
        .style51
        {
       }
        .style56
        {
       }
        .style57
        {
            width: 143px;
        }
        .style58
        {
            width: 242px;
        }
        .style59
        {
            width: 239px;
           font-weight: 700;
       }
        .style62
        {
            width: 144px;
            text-align: left;
            font-weight: 700;
        }
        .style63
        {
            text-align: right;
        }
        .style66
        {
            text-align: right;
            font-weight: 700;
        }
        .style67
        {
            width: 187px;
            text-align: right;
            font-weight: 700;
        }
        .style68
        {
            width: 147px;
            text-align: left;
            font-weight: 700;
        }
       .style70
       {
           width: 230px;
       }
       .style76
       {
           width: 107px;
           text-align: right;
       }
       .style77
       {
           text-align: left;
           font-weight: 700;
       }
       .style80
       {
           width: 190px;
           text-align: right;
           font-weight: 700;
       }
       .style81
       {
           width: 144px;
           text-align: right;
           font-weight: 700;
       }
       .style82
       {
           width: 171px;
           height: 16px;
       }
       .style83
       {
           width: 193px;
           height: 16px;
       }
       .style84
       {
           width: 143px;
           height: 16px;
       }
       .style85
       {
           width: 242px;
           height: 16px;
       }
       .style86
       {
           height: 16px;
           font-weight: 700;
       }
       .style87
       {
           width: 190px;
       }
    </style>

        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table cellpadding="0" cellspacing="0" class="style2">
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <strong>บันทึกวันลา นักเรียน / ครู / พนักงาน</strong></td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style15">
                            <tr>
                                <td class="style32" colspan="6">
                                    <table cellpadding="0" cellspacing="0" class="style15">
                                        <tr>
                                            <td class="style80">
                                                <strong>ผู้ลา :</strong></td>
                                            <td class="style70">
                                                <asp:RadioButtonList ID="RadioButtonList5" runat="server" AutoPostBack="True" 
                                                    RepeatDirection="Horizontal" Width="192px" 
                                                    >
                                                    <asp:ListItem Value="0">ครู</asp:ListItem>
                                                    <asp:ListItem Value="1">นักเรียน</asp:ListItem>
                                                    <asp:ListItem Value="2">พนักงาน</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                            <td class="style76">
                                                <strong>วันลา :</strong></td>
                                            <td>
                                                <asp:TextBox ID="leaveDate" runat="server" Width="100px"></asp:TextBox>
                                                <script type="text/javascript">
                                                    $(Sys.Application.add_load(function () {
                                                        var dateBefore = null;

                                                        $("#ContentPlaceHolder1_leaveDate").datepicker({

                                                            changeMonth: true,
                                                            changeYear: true,
                                                            showOn: 'button',
                                                            isBuddhist: true,
                                                            buttonImage: 'images/formcal.gif',
                                                            buttonImageOnly: true

                                                        });

                                                    }));
                                                 </script>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style87">
                                                &nbsp;</td>
                                            <td class="style70">
                                                &nbsp;</td>
                                            <td class="style76">
                                                &nbsp;</td>
                                            <td style="text-align: right">
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="style32" colspan="6">
                                    <table cellpadding="0" cellspacing="0" class="style15" id="Tab0"  style ="display:none">
                                        <tr>
                                            <td class="style80">
                                                <strong style="text-align: right">รหัสครู : </strong></td>
                                            <td class="style49">
                                                <asp:TextBox ID="empCode" runat="server" Width="100px" onkeydown="gotoButton(event)"   onkeypress ="gotoButton(event)"></asp:TextBox>
                                                <asp:Button ID="CMD_EmpCode" runat="server" onclick="CMD_EmpCode_Click" OnClientClick="return chButton()" 
                                      Text="ค้นหา" CssClass="stylebutton" style="display:none"/>
                                                <asp:TextBox ID="empId" runat="server" Width="100px" style ="display:none"></asp:TextBox>
                                                <asp:TextBox ID="empClsMastId" runat="server" Width="100px" style ="display:none"></asp:TextBox>
                                                <asp:TextBox ID="clsLeaveDetailId" runat="server" Width="100px" style ="display:none"></asp:TextBox>
                                                </td>
                                            <td class="style81">
                                                <b style="text-align: right">ชื่อ-นามสกุลครู :</b></td>
                                            <td class="style59">
                                                <asp:TextBox ID="empName" runat="server" Width="169px"></asp:TextBox>
                                                <asp:TextBox ID="num"  runat="server" Width="169px" EnableViewState="false" style = "display:none"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                <strong>ประเภท :</strong></td>
                                            <td class="style49">
                                                <asp:RadioButtonList ID="RadioButtonList3" runat="server" 
                                                    RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0">ลาล่วงหน้า</asp:ListItem>
                                                    <asp:ListItem Value="1">ลาทีหลัง</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                            <td class="style62">
                                                <asp:Button ID="Button1" runat="server" Text="ค้นหานักเรียน" 
                                                    onclick="Button1_Click" />
                                            </td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style68">
                                                รายชื่อนักเรียน</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style63" colspan="5">
                                                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" 
                            border="1" CellPadding="4" CssClass="DataGrid_Footer" ForeColor="#333333" 
                            GridLines="None" Width="100%" HorizontalAlign="Center" 
                            DataKeyNames="emp_cls_mast_id" >
                            <AlternatingRowStyle BackColor="PaleGoldenrod" />
                            <Columns>
                                <%--<asp:TemplateField HeaderText="เลือก" >
		                            <ItemTemplate>
			                            <asp:CheckBox id="chkBox" runat="server"></asp:CheckBox>
		                            </ItemTemplate>
	                            </asp:TemplateField>--%>
                                <%--<asp:CommandField ButtonType="Image" HeaderText="เลือกวิชาที่ลา" 
                                        ItemStyle-HorizontalAlign="Center" 
                                        SelectImageUrl="~/Pages/images/search1.png" ShowSelectButton="True" >
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:CommandField>--%>
                                <asp:TemplateField HeaderText="ลำดับ">
                                    <HeaderTemplate>
                                        ลำดับ
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                       <%#Container.DataItemIndex+1 %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField Visible="false">
                                    <ItemTemplate>
                                       <asp:HiddenField ID="HiddenField3" runat="server" Visible="false"
                                          Value='<%# Eval("emp_cls_mast_id") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="emp_code" HeaderText="รหัสนักเรียน"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="emp_name" HeaderText="ชื่อ-นามสกุลนักเรียน"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="cls_reg_code" HeaderText="รหัสวิชา"
                                    ItemStyle-HorizontalAlign="left" >
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="cls_name" HeaderText="วิชา"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="emp_cls_day" HeaderText="วันที่สอน"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="emp_cls_start" HeaderText="เวลาเริ่ม"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="emp_cls_end" HeaderText="เวลาสิ้นสุด"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="st_phone" HeaderText="เบอร์โทรศัพท์"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:TemplateField HeaderText="วันที่ล่า">
                                      <ItemTemplate>
                                          <asp:Label ID="Label1" runat="server" Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("st_dateschedule")) %>'></asp:Label>
                                      </ItemTemplate>
                                       <HeaderStyle HorizontalAlign="center" />
                                       <ItemStyle HorizontalAlign="center" />
                                </asp:TemplateField>
                                
                                
                                
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                <asp:Button ID="CMD_INSERT" runat="server" Text="  บันทึก  " Width="60px" 
                                                OnClick="CMD_INSERT_Click" OnClientClick = "return validate()"/>
                                                &nbsp;<asp:Button ID="CMD_EDIT" runat="server" Text="แก้ไข" 
                                                OnClick="CMD_INSERT_Click"/>
                                                <%--&nbsp;<asp:Button ID="CMD_CLEAR" runat="server" Text="  เคลียร์  " Width="60px" 
                                                OnClick="CMD_CLEAR_Click" />--%>
                                            </td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style77">
                                                การลา</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style66" colspan="5">
                                                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false" 
                                                    border="1" CellPadding="4" CssClass="DataGrid_Footer" 
                                                    DataKeyNames="cls_leave_detail_id" ForeColor="#333333" GridLines="None" 
                                                    HorizontalAlign="Center" OnRowDeleting ="GridView2_RowDeleting"
                                                    OnSelectedIndexChanging="GridView2_SelectedIndexChanging" Width="100%">
                                                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                                                    <Columns>
                                                        
                                                        
                                                        <asp:TemplateField HeaderText="ลำดับ">
                                                            <HeaderTemplate>
                                                                ลำดับ
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <%#Container.DataItemIndex+1 %>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField Visible="false">
                                                            <ItemTemplate>
                                                                <asp:HiddenField ID="HiddenField4" runat="server" 
                                                                    Value='<%# Eval("cls_leave_detail_id") %>' Visible="false" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="emp_code" HeaderText="รหัสครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="emp_name" HeaderText="ชื่อ-นามสกุลครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        
                                                        <asp:TemplateField HeaderText="วันที่ล่า">
                                      <ItemTemplate>
                                          <asp:Label ID="Label1" runat="server" Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("leave_date")) %>'></asp:Label>
                                      </ItemTemplate>
                                       <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="center" />
                                </asp:TemplateField>
                                                        
                                                        
                                                        <asp:BoundField DataField="cus_type_desc" HeaderText="ประเภทพนักงาน" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="leave_type_desc" HeaderText="ประเภทการลา" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:CommandField ButtonType="Image" HeaderText="แก้ไข" 
                                                            ItemStyle-HorizontalAlign="Center" 
                                                            SelectImageUrl="~/Pages/images/icon_15.gif" ShowSelectButton="True" >
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </asp:CommandField>
                                                        <asp:CommandField ButtonType="Image" HeaderText="ลบ" 
                                                            ItemStyle-HorizontalAlign="Center" 
                                                            SelectImageUrl="~/Pages/images/icon_del.gif"  
                                                            ShowDeleteButton="True" DeleteImageUrl="~/Pages/images/icon_del.gif" 
                                                            DeleteText="" >
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </asp:CommandField>
                                                    </Columns>
                                                    <EditRowStyle BackColor="#2461BF" />
                                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
                                                        HorizontalAlign="Center" />
                                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#EFF3FB" />
                                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                    <table cellpadding="0" cellspacing="0" class="style15" id="Tab1" style ="display:none">
                                        <tr>
                                            <td class="style80">
                                                <strong style="text-align: right">รหัสนักเรียน : </strong>
                                            </td>
                                            <td class="style49">
                                                <asp:TextBox ID="stCode" runat="server" onkeydown="gotoButton(event)" 
                                                    onkeypress="gotoButton(event)" Width="100px"></asp:TextBox>
                                                <asp:Button ID="CMD_StCode" runat="server" CssClass="stylebutton" 
                                                    onclick="CMD_StCode_Click" OnClientClick="return chButton()" 
                                                    style="display:none" Text="ค้นหา" />
                                                <asp:TextBox ID="stId" runat="server" style="display:none" Width="100px"></asp:TextBox>
                                                <asp:TextBox ID="empClsMastId2" runat="server" style="display:none" 
                                                    Width="100px"></asp:TextBox>
                                                <asp:TextBox ID="clsLeaveDetailId2" runat="server" style="display:none" 
                                                    Width="100px"></asp:TextBox>
                                            </td>
                                            <td class="style81">
                                                <b style="text-align: right">ชื่อ-นามสกุลนักเรียน :</b></td>
                                            <td class="style59">
                                                <asp:TextBox ID="stName" runat="server" Width="169px"></asp:TextBox>
                                                <asp:TextBox ID="num0" runat="server" EnableViewState="false" 
                                                    style="display:none" Width="169px"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style82">
                                                </td>
                                            <td class="style83">
                                                </td>
                                            <td class="style84">
                                                </td>
                                            <td class="style85">
                                                </td>
                                            <td class="style86">
                                                </td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                <strong>ประเภท :</strong></td>
                                            <td class="style49">
                                                <asp:RadioButtonList ID="RadioButtonList6" runat="server" 
                                                    RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0">ลาล่วงหน้า</asp:ListItem>
                                                    <asp:ListItem Value="1">ลาทีหลัง</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                            <td class="style62">
                                                <asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
                                                    Text="ค้นหาครู" />
                                            </td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style56">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style58">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style56">
                                                <strong>รายชื่อครู</strong></td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style58">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style56" colspan="5">
                                                <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="false" 
                                                    border="1" CellPadding="4" CssClass="DataGrid_Footer" 
                                                    DataKeyNames="emp_cls_mast_id" ForeColor="#333333" GridLines="None" 
                                                    HorizontalAlign="Center" Width="100%">
                                                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                                                    <Columns>
                                                        <%--<asp:TemplateField HeaderText="เลือก" >
		                            <ItemTemplate>
			                            <asp:CheckBox id="chkBox" runat="server"></asp:CheckBox>
		                            </ItemTemplate>
	                            </asp:TemplateField>--%><%--<asp:CommandField ButtonType="Image" HeaderText="เลือกวิชาที่ลา" 
                                        ItemStyle-HorizontalAlign="Center" 
                                        SelectImageUrl="~/Pages/images/search1.png" ShowSelectButton="True" >
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:CommandField>--%>
                                                        <asp:TemplateField HeaderText="ลำดับ">
                                                            <HeaderTemplate>
                                                                ลำดับ
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <%#Container.DataItemIndex+1 %>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField Visible="false">
                                                            <ItemTemplate>
                                                                <asp:HiddenField ID="HiddenField5" runat="server" 
                                                                    Value='<%# Eval("emp_cls_mast_id") %>' Visible="false" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="emp_code" HeaderText="รหัสครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="emp_name" HeaderText="ชื่อ-นามสกุลครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="cls_reg_code" HeaderText="รหัสวิชา" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="cls_name" HeaderText="วิชา" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="emp_cls_day" HeaderText="วันที่สอน" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="emp_cls_start" HeaderText="เวลาเริ่ม" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="emp_cls_end" HeaderText="เวลาสิ้นสุด" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="emp_phone" HeaderText="เบอร์โทรศัพท์" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:TemplateField HeaderText="วันที่ล่า">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Label2" runat="server" 
                                                                    Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("emp_dateschedule")) %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="center" />
                                                            <ItemStyle HorizontalAlign="center" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <EditRowStyle BackColor="#2461BF" />
                                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
                                                        HorizontalAlign="Center" />
                                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#EFF3FB" />
                                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style56">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style58">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style56">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style58">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                <asp:Button ID="CMD_INSERT_student" runat="server" OnClick="CMD_INSERT_Click_student" 
                                                    OnClientClick="return validate()" Text="  บันทึก  " Width="60px" />
                                                &nbsp;<asp:Button ID="CMD_EDIT_student" runat="server" OnClick="CMD_INSERT_Click_student" 
                                                    Text="แก้ไข" />
                                                <%--&nbsp;<asp:Button ID="CMD_CLEAR" runat="server" Text="  เคลียร์  " Width="60px" 
                                                OnClick="CMD_CLEAR_Click" />--%>
                                            </td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style56">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style58">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style86">
                                                การลา</td>
                                            <td class="style83">
                                            </td>
                                            <td class="style84">
                                            </td>
                                            <td class="style85">
                                            </td>
                                            <td class="style86">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style56" colspan="5">
                                                <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="false" 
                                                    border="1" CellPadding="4" CssClass="DataGrid_Footer" 
                                                    DataKeyNames="cls_leave_detail_id" ForeColor="#333333" GridLines="None" 
                                                    HorizontalAlign="Center" 
                                                    OnSelectedIndexChanging="GridView4_SelectedIndexChanging" Width="100%"
                                                    OnRowDeleting = "GridView4_RowDeleting" >
                                                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="ลำดับ">
                                                            <HeaderTemplate>
                                                                ลำดับ
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <%#Container.DataItemIndex+1 %>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField Visible="false">
                                                            <ItemTemplate>
                                                                <asp:HiddenField ID="HiddenField6" runat="server" 
                                                                    Value='<%# Eval("cls_leave_detail_id") %>' Visible="false" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="st_code" HeaderText="รหัสครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="st_name" HeaderText="ชื่อ-นามสกุลครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:TemplateField HeaderText="วันที่ล่า">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Label3" runat="server" 
                                                                    Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("leave_date")) %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="center" />
                                                            <ItemStyle HorizontalAlign="center" />
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="cus_type_desc" HeaderText="ประเภทพนักงาน" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="leave_type_desc" HeaderText="ประเภทการลา" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:CommandField ButtonType="Image" HeaderText="แก้ไข" 
                                                            ItemStyle-HorizontalAlign="Center" SelectImageUrl="~/Pages/images/icon_15.gif" 
                                                            ShowSelectButton="True">
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:CommandField>
                                                        <asp:CommandField ButtonType="Image" 
                                                            DeleteImageUrl="~/Pages/images/icon_del.gif" DeleteText="" HeaderText="ลบ" 
                                                            ItemStyle-HorizontalAlign="Center" SelectImageUrl="~/Pages/images/icon_del.gif" 
                                                            ShowDeleteButton="True">
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:CommandField>
                                                    </Columns>
                                                    <EditRowStyle BackColor="#2461BF" />
                                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
                                                        HorizontalAlign="Center" />
                                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#EFF3FB" />
                                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style56">
                                                &nbsp;</td>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style58">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                    <table cellpadding="0" cellspacing="0" class="style15" id="Tab2" style ="display:none">
                                     
                                        <tr>
                                            <td class="style80">
                                                <strong style="text-align: right">รหัสพนักงาน : </strong>
                                            </td>
                                            <td class="style49">
                                                <asp:TextBox ID="cusCode" runat="server" onkeydown="gotoButton(event)" 
                                                    onkeypress="gotoButton(event)" Width="100px"></asp:TextBox>
                                                <asp:Button ID="CMD_CusCode" runat="server" CssClass="stylebutton" 
                                                    onclick="CMD_CusCode_Click" OnClientClick="return chButton()" 
                                                    style="display:none" Text="ค้นหา" />
                                                <asp:TextBox ID="cusId" runat="server" style="display:none" Width="100px"></asp:TextBox>
                                                <asp:TextBox ID="empClsMastId3" runat="server" style="display:none" 
                                                    Width="100px"></asp:TextBox>
                                                <asp:TextBox ID="clsLeaveDetailId3" runat="server" style="display:none" 
                                                    Width="100px"></asp:TextBox>
                                            </td>
                                            <td class="style81">
                                                <b style="text-align: right">ชื่อ-นามสกุลพนักงาน :</b></td>
                                            <td class="style59">
                                                <asp:TextBox ID="cusName" runat="server" Width="169px"></asp:TextBox>
                                                <asp:TextBox ID="num1" runat="server" EnableViewState="false" 
                                                    style="display:none" Width="169px"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style82">
                                            </td>
                                            <td class="style83">
                                            </td>
                                            <td class="style84">
                                            </td>
                                            <td class="style85">
                                            </td>
                                            <td class="style86">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                <strong>ประเภท :</strong></td>
                                            <td class="style49">
                                                <asp:RadioButtonList ID="RadioButtonList7" runat="server" 
                                                    RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0">ลาล่วงหน้า</asp:ListItem>
                                                    <asp:ListItem Value="1">ลาทีหลัง</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                            <td class="style62">
                                                <asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                                                    Text="ค้นหาครู" />
                                            </td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style51">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style51">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style80">
                                                &nbsp;</td>
                                            <td class="style49">
                                                <asp:Button ID="CMD_INSERT_customer" runat="server" 
                                                    OnClick="CMD_INSERT_Click_customer" OnClientClick="return validate()" 
                                                    Text="  บันทึก  " Width="60px" />
                                                &nbsp;<asp:Button ID="CMD_EDIT_customer" runat="server" 
                                                    OnClick="CMD_INSERT_Click_customer" Text="แก้ไข" />
                                                <%--&nbsp;<asp:Button ID="CMD_CLEAR" runat="server" Text="  เคลียร์  " Width="60px" 
                                                OnClick="CMD_CLEAR_Click" />--%>
                                            </td>
                                            <td class="style62">
                                                &nbsp;</td>
                                            <td class="style59">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style51">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style51">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style51" colspan="5">
                                                <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="false" 
                                                    border="1" CellPadding="4" CssClass="DataGrid_Footer" 
                                                    DataKeyNames="cls_leave_detail_id" ForeColor="#333333" GridLines="None" 
                                                    HorizontalAlign="Center" 
                                                    OnSelectedIndexChanging="GridView5_SelectedIndexChanging" Width="100%"
                                                    OnRowDeleting ="GridView5_RowDeleting">
                                                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="ลำดับ">
                                                            <HeaderTemplate>
                                                                ลำดับ
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <%#Container.DataItemIndex+1 %>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField Visible="false">
                                                            <ItemTemplate>
                                                                <asp:HiddenField ID="HiddenField8" runat="server" 
                                                                    Value='<%# Eval("cls_leave_detail_id") %>' Visible="false" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="emp_code" HeaderText="รหัสครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="emp_name" HeaderText="ชื่อ-นามสกุลครู" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:TemplateField HeaderText="วันที่ล่า">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Label5" runat="server" 
                                                                    Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("leave_date")) %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="center" />
                                                            <ItemStyle HorizontalAlign="center" />
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="cus_type_desc" HeaderText="ประเภทพนักงาน" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="leave_type_desc" HeaderText="ประเภทการลา" 
                                                            ItemStyle-HorizontalAlign="left">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        </asp:BoundField>
                                                        <asp:CommandField ButtonType="Image" HeaderText="แก้ไข" 
                                                            ItemStyle-HorizontalAlign="Center" SelectImageUrl="~/Pages/images/icon_15.gif" 
                                                            ShowSelectButton="True">
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:CommandField>
                                                        <asp:CommandField ButtonType="Image" 
                                                            DeleteImageUrl="~/Pages/images/icon_del.gif" DeleteText="" HeaderText="ลบ" 
                                                            ItemStyle-HorizontalAlign="Center" SelectImageUrl="~/Pages/images/icon_del.gif" 
                                                            ShowDeleteButton="True">
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:CommandField>
                                                    </Columns>
                                                    <EditRowStyle BackColor="#2461BF" />
                                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
                                                        HorizontalAlign="Center" />
                                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#EFF3FB" />
                                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style51">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="style32" colspan="6">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style32" colspan="6">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style32">
                                    &nbsp;</td>
                                <td class="style21">
                                    &nbsp;</td>
                                <td class="style16">
                                    &nbsp;</td>
                                <td class="style27">
                                    &nbsp;</td>
                                <td class="style24">
                                    &nbsp;</td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style20">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
     <br />
     <script type="text/javascript">

         $(Sys.Application.add_load(function () {


             $("#ContentPlaceHolder1_empCode").focusout(function () {

                 $("#ContentPlaceHolder1_CMD_EmpCode").click();
             })

             $("#ContentPlaceHolder1_stCode").focusout(function () {

                 $("#ContentPlaceHolder1_CMD_StCode").click();
             })

             $("#ContentPlaceHolder1_cusCode").focusout(function () {

                 $("#ContentPlaceHolder1_CMD_CusCode").click();
             })

             $("#ContentPlaceHolder1_RadioButtonList5").ready(function () {

                 //$("#ContentPlaceHolder1_RadioButtonList5 input:radio:checked").val(2);
                 //$('input:radio')[1].checked = true;
                 //alert($('input:radio:checked').val());
                 if ($('input:radio:checked').val() == 0) {
                     $('#Tab0').css('display', 'block');
                     $('#Tab1').css('display', 'none');
                     $('#Tab2').css('display', 'none');
                 } else if ($('input:radio:checked').val() == 1) {
                     $('#Tab0').css('display', 'none');
                     $('#Tab1').css('display', 'block');
                     $('#Tab2').css('display', 'none');

                 } else if ($('input:radio:checked').val() == 2) {
                     $('#Tab0').css('display', 'none');
                     $('#Tab1').css('display', 'none');
                     $('#Tab2').css('display', 'block');

                 }
             })

             $("#ContentPlaceHolder1_Button1,#ContentPlaceHolder1_CMD_INSERT,#ContentPlaceHolder1_CMD_EDIT").click(function () {
                if ($("#ContentPlaceHolder1_empCode").val() == "") {
                    alert("กรุณาระบุรหัสครู");
                
                    return (false);
                }
                if ($("#ContentPlaceHolder1_leaveDate").val() == "") {
                    alert("กรุณาระบุวันลา");

                    return (false);
                }

            })

            $("#ContentPlaceHolder1_Button2,#ContentPlaceHolder1_CMD_INSERT_student,#ContentPlaceHolder1_CMD_EDIT_student").click(function () {
                if ($("#ContentPlaceHolder1_stCode").val() == "") {
                    alert("กรุณาระบุรหัสนักเรียน");

                    return (false);
                }
                if ($("#ContentPlaceHolder1_leaveDate").val() == "") {
                    alert("กรุณาระบุวันลา");

                    return (false);
                }

            })
            $("#ContentPlaceHolder1_Button3,#ContentPlaceHolder1_CMD_INSERT_customer,#ContentPlaceHolder1_CMD_EDIT_customer").click(function () {
                if ($("#ContentPlaceHolder1_cusCode").val() == "") {
                    alert("กรุณาระบุรหัสครู");

                    return (false);
                }
                if ($("#ContentPlaceHolder1_leaveDate").val() == "") {
                    alert("กรุณาระบุวันลา");

                    return (false);
                }

            })

         }));
    </script>
    <script type ="text/javascript">
//        function gotoButton(e) {
//            var keyPressed;
//            if (window.event) {
//                keyPressed = window.event.keyCode; // IE
//                if (keyPressed == 13) {


//                    //  document.getElementById("CMD_AgentCode").focus();
//                    document.getElementById('ContentPlaceHolder1_CMD_EmpCode').click();
//                }

//            } else {
//                keyPressed = e.which; // Firefox
//                if (keyPressed == 13) {
//                    document.getElementById('ContentPlaceHolder1_CMD_EmpCode').click();
//                    //document.getElementById("CMD_AgentCode").focus();
//                }

//            }
//        }

//        function chButton() {

//            if (document.getElementById("ContentPlaceHolder1_empCode").value == "") {
//                alert("กรุณาระบุรหัสครูเพื่อค้นหาครูผู้สอน");
//                //document.getElementById("AgentCode").focus();
//                return (false);
//            }
//            if (document.getElementById("ContentPlaceHolder1_empCode").value.length != 2) {
//                //alert("กรุณาระบุรหัสตัวแทนให้ครบ 6 หลัก");
//                document.getElementById("ContentPlaceHolder1_empId").focus();
//                return (false);
//            }



//            return true;

//        } function gotoButton2(e) {
//            var keyPressed;
//            if (window.event) {
//                keyPressed = window.event.keyCode; // IE
//                if (keyPressed == 13) {


//                    //  document.getElementById("CMD_AgentCode").focus();
//                    document.getElementById('ContentPlaceHolder1_CMD_CourseCode').click();
//                }

//            } else {
//                keyPressed = e.which; // Firefox
//                if (keyPressed == 13) {
//                    document.getElementById('ContentPlaceHolder1_CMD_CourseCode').click();
//                    //document.getElementById("CMD_AgentCode").focus();
//                }

//            }
//        }

//        function chButton2() {

//            if (document.getElementById("ContentPlaceHolder1_clsRegCode").value == "") {
//                alert("กรุณาระบุรหัสครูเพื่อค้นหาครูผู้สอน");
//                //document.getElementById("AgentCode").focus();
//                return (false);
//            }
//            if (document.getElementById("ContentPlaceHolder1_clsRegCode").value.length != 2) {
//                //alert("กรุณาระบุรหัสตัวแทนให้ครบ 6 หลัก");
//                document.getElementById("ContentPlaceHolder1_clsRegId").focus();
//                return (false);
//            }



//            return true;

//        }
        </script>
   
</asp:Content>